<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>AUnit: aunit::fake::FakePrint Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">AUnit
   &#160;<span id="projectnumber">1.7.1</span>
   </div>
   <div id="projectbrief">Unit testing framework for Arduino platforms inspired by ArduinoUnit and Google Test.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>aunit</b></li><li class="navelem"><b>fake</b></li><li class="navelem"><a class="el" href="classaunit_1_1fake_1_1FakePrint.html">FakePrint</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-attribs">Static Public Attributes</a> &#124;
<a href="classaunit_1_1fake_1_1FakePrint-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">aunit::fake::FakePrint Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>An implementation of Print that writes to an in-memory buffer.  
 <a href="classaunit_1_1fake_1_1FakePrint.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="FakePrint_8h_source.html">FakePrint.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for aunit::fake::FakePrint:</div>
<div class="dyncontent">
<div class="center"><img src="classaunit_1_1fake_1_1FakePrint__inherit__graph.png" border="0" usemap="#aaunit_1_1fake_1_1FakePrint_inherit__map" alt="Inheritance graph"/></div>
<map name="aaunit_1_1fake_1_1FakePrint_inherit__map" id="aaunit_1_1fake_1_1FakePrint_inherit__map">
<area shape="rect" title="An implementation of Print that writes to an in&#45;memory buffer." alt="" coords="5,80,164,107"/>
<area shape="rect" title=" " alt="" coords="59,5,111,32"/>
</map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<div class="dynheader">
Collaboration diagram for aunit::fake::FakePrint:</div>
<div class="dyncontent">
<div class="center"><img src="classaunit_1_1fake_1_1FakePrint__coll__graph.png" border="0" usemap="#aaunit_1_1fake_1_1FakePrint_coll__map" alt="Collaboration graph"/></div>
<map name="aaunit_1_1fake_1_1FakePrint_coll__map" id="aaunit_1_1fake_1_1FakePrint_coll__map">
<area shape="rect" title="An implementation of Print that writes to an in&#45;memory buffer." alt="" coords="5,80,164,107"/>
<area shape="rect" title=" " alt="" coords="59,5,111,32"/>
</map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a7d54d6bd469341709fc7838b76cd487e"><td class="memItemLeft" align="right" valign="top"><a id="a7d54d6bd469341709fc7838b76cd487e"></a>
size_t&#160;</td><td class="memItemRight" valign="bottom"><b>write</b> (uint8_t c) override</td></tr>
<tr class="separator:a7d54d6bd469341709fc7838b76cd487e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a60bec0a04b2fdf7ff4e9a59f5f712d7c"><td class="memItemLeft" align="right" valign="top"><a id="a60bec0a04b2fdf7ff4e9a59f5f712d7c"></a>
size_t&#160;</td><td class="memItemRight" valign="bottom"><b>write</b> (const uint8_t *buffer, size_t size) override</td></tr>
<tr class="separator:a60bec0a04b2fdf7ff4e9a59f5f712d7c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a43ad99b88e7a0b38f71ac620589efaed"><td class="memItemLeft" align="right" valign="top"><a id="a43ad99b88e7a0b38f71ac620589efaed"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>flush</b> () override</td></tr>
<tr class="separator:a43ad99b88e7a0b38f71ac620589efaed"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab3a88258aa921031badaed5f24a676e5"><td class="memItemLeft" align="right" valign="top">const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classaunit_1_1fake_1_1FakePrint.html#ab3a88258aa921031badaed5f24a676e5">getBuffer</a> () const</td></tr>
<tr class="memdesc:ab3a88258aa921031badaed5f24a676e5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the NUL terminated string buffer.  <a href="classaunit_1_1fake_1_1FakePrint.html#ab3a88258aa921031badaed5f24a676e5">More...</a><br /></td></tr>
<tr class="separator:ab3a88258aa921031badaed5f24a676e5"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-attribs"></a>
Static Public Attributes</h2></td></tr>
<tr class="memitem:a20b52e8228ca50714c04f94efb554053"><td class="memItemLeft" align="right" valign="top">static const uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classaunit_1_1fake_1_1FakePrint.html#a20b52e8228ca50714c04f94efb554053">kBufSize</a> = 8 * sizeof(long long) + 2 + 1</td></tr>
<tr class="memdesc:a20b52e8228ca50714c04f94efb554053"><td class="mdescLeft">&#160;</td><td class="mdescRight">Size of the internal buffer.  <a href="classaunit_1_1fake_1_1FakePrint.html#a20b52e8228ca50714c04f94efb554053">More...</a><br /></td></tr>
<tr class="separator:a20b52e8228ca50714c04f94efb554053"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>An implementation of Print that writes to an in-memory buffer. </p>
<p>The buffer can be retrieved using <a class="el" href="classaunit_1_1fake_1_1FakePrint.html#ab3a88258aa921031badaed5f24a676e5" title="Return the NUL terminated string buffer.">getBuffer()</a> to verify that the expected string was written to the Print object.</p>
<p>Usage: </p><pre class="fragment">* {
*   FakePrint fakePrint;
*   object.printTo(fakePrint);
*   assertEqual("expected", fakePrint.getBuffer());
*   fakePrint.flush();
*   ...
* }
* </pre><p>The internal buffer size is just big enough to hold a <code>long long</code> (8 bytes) with 3 bytes to hold the <code>\\r\\n</code> from a <code>println()</code> statement and the terminating NUL character.</p>
<p>This class is an early version of the PrintStr class of the AceCommon library. We don't want to change AUnit to use PrintStr instead because we use AUnit to write the unit tests for AceCommon itself, and it would cause a conceptual cyclic dependency. Also we want AUnit to be self-contained without additional dependencies. </p>

<p class="definition">Definition at line <a class="el" href="FakePrint_8h_source.html#l00060">60</a> of file <a class="el" href="FakePrint_8h_source.html">FakePrint.h</a>.</p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="ab3a88258aa921031badaed5f24a676e5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab3a88258aa921031badaed5f24a676e5">&#9670;&nbsp;</a></span>getBuffer()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const char* aunit::fake::FakePrint::getBuffer </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Return the NUL terminated string buffer. </p>
<p>After the buffer is no longer needed, the flush() method should be called to reset the internal buffer index to 0. </p>

<p class="definition">Definition at line <a class="el" href="FakePrint_8h_source.html#l00104">104</a> of file <a class="el" href="FakePrint_8h_source.html">FakePrint.h</a>.</p>

</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a id="a20b52e8228ca50714c04f94efb554053"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a20b52e8228ca50714c04f94efb554053">&#9670;&nbsp;</a></span>kBufSize</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const uint8_t aunit::fake::FakePrint::kBufSize = 8 * sizeof(long long) + 2 + 1</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Size of the internal buffer. </p>
<p>This is just large enough to hold the string representation of one 64-bit integer in binary format (64 bytes), including 2 bytes for the '\r\n' from println() and 1 byte for the terminating NUL. </p>

<p class="definition">Definition at line <a class="el" href="FakePrint_8h_source.html#l00068">68</a> of file <a class="el" href="FakePrint_8h_source.html">FakePrint.h</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>/home/brian/src/AUnit/src/aunit/fake/<a class="el" href="FakePrint_8h_source.html">FakePrint.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1
</small></address>
</body>
</html>
